<template>
  <div class="">
    <mydizhi @click.native="gotoAdddizhi"/>
    <div class="one">
      <div class="pi-title">
        <div class="title">
          <p class="p2">面授课</p>
          <p class="p3">{{ item.title }}</p>
        </div>
        <p class="price">{{ item.price }}</p>
      </div>
      <p class="pi-teacher" style="color: #ccc">共{{ item.sales_num }}课时</p>
    </div>
    <myyhj />
    <div class="one">
      <div class="pi-price">
        <p>
          <span>商品金额</span><span class="p">{{ item.price + ".00" }}</span>
        </p>
        <p>
          <span>优惠卷金额</span><span class="p">-{{ item.browse_base }}</span>
        </p>
        <p>
          <span>合计</span
          ><span style="color: red; float: right">{{
            item.price + ".00"
          }}</span>
        </p>
      </div>
    </div>
    <van-submit-bar
      :price="item.price * 100"
      button-text="提交订单"
      label="实付价格"
      @click.native="addDizhi"
    />
  </div>
</template>

<script>
import mydizhi from "../../components/yueke/mydizhi.vue";
import myyhj from "../../components/yueke/myyhj.vue";
import { Dialog } from "vant";
export default {
  data() {
    return {
      item: JSON.parse(this.$route.query.item),
    };
  },
  mounted() {},
  methods: {
    addDizhi() {
      Dialog.confirm({
        // title: "标题",
        message: "您还没有添加地址,请点击添加收货地址",
      })
        .then(() => {
          // on confirm
          // this.$router.push('/classAdddizhi')
        })
        .catch(() => {
          // on cancel
        });
    },
    gotoAdddizhi(){ //跳转添加地址页
       this.$router.push('/classjiadizhi')
    }
  },
  components: {
    mydizhi,
    myyhj,
  },
};
</script>

<style lang='scss' scoped>
.one {
  border-radius: 9px;
  background-color: rgb(250, 250, 250);
  width: 95%;
  height: 80px;
  border: 1px rgb(235, 233, 233) solid;
  display: flex;
  margin-left: 10px;
  margin-top: 10px;
  padding: 12px 15px;
  flex-wrap: wrap;
  .pi-title {
    width: 100%;
    display: flex;
    justify-content: space-between;
    .p2 {
      display: inline-block;
      font-size: 0.24rem;
      font-size: 2.4vw;
      padding: 0.10667rem 0.13333rem;
      padding: 1.06667vw 1.33333vw;
      background: #fdf3eb;
      border-radius: 0.05333rem;
      border-radius: 0.53333vw;
      color: #ea7a2f;
      margin-right: 0.16rem;
      margin-right: 1.6vw;
      vertical-align: 0.08rem;
      vertical-align: 0.8vw;
    }
    .p3 {
      display: inline;
      line-height: 0.56rem;
      line-height: 5.6vw;
      font-size: 0.37333rem;
      font-size: 3.73333vw;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: rgba(0, 0, 0, 0.85);
      vertical-align: bottom;
    }
    .price {
      flex: none;
      font-size: 0.42667rem;
      font-size: 4.26667vw;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #ee1f1f;
      line-height: 0.56rem;
      line-height: 5.6vw;
    }
  }
  .pi-price {
    width: 100%;
    p {
      width: 100%;
      height: 21.6px;
      .p {
        float: right;
      }
    }
  }
}
</style>
